import React from 'react';
import {Checkbox} from 'antd';
const CheckboxGroup = Checkbox.Group;
import {WeaSearchGroup, WeaFormItem} from 'ecCom';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
import EType from './base/EType';
import ETitle from './base/ETitle';
import EShowNum from './base/EShowNum';
import ELinkMode from './base/ELinkMode';
import EShowHeader from './base/EShowHeader';
//import EField from './base/EField';
import DataSourceTable from './base/DataSourceTable';

// 我的项目
export default class Content_10_new extends React.Component {
    state = {
    };

    render() {
        const {eShowContent} = this.state;
        let __DataSourceTable = <div></div>;
        if (this.props.eShareLevel == '2') {
            __DataSourceTable = <DataSourceTable ecId={`${this && this.props && this.props.ecId || ''}_DataSourceTable@bofshn`} ref="dataSourceTable" ebaseid="10" {...this.props.eTabs}/>;
        }
        return (
            <div>
                <WeaSearchGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaSearchGroup@8n8f8o`} title={getLabel(81711, '基本信息')} needTigger={true} showGroup={true}>
                    <EType ecId={`${this && this.props && this.props.ecId || ''}_EType@rcb2q3`} ref="eType" value={this.props.eBaseName}/>
                    {this.props.eShareLevel == '2' ? <ETitle ecId={`${this && this.props && this.props.ecId || ''}_ETitle@xq93f5`} ref="eTitle" eid={this.props.eid} value={this.props.eTitle}  {...this.props}/> : ''}
                    <EShowNum ecId={`${this && this.props && this.props.ecId || ''}_EShowNum@ehatcq`} ref="eShowNum" value={this.props.eShowNum}/>
                    <ELinkMode ecId={`${this && this.props && this.props.ecId || ''}_ELinkMode@m46uxp`} ref="eLinkMode" options={this.props.eLinkMode.options} value={this.props.eLinkMode.selected}/>
                    <EShowHeader ecId={`${this && this.props && this.props.ecId || ''}_EShowHeader@byy8ct`} ref="eShowHeader" value={this.props.showHeader}/>
                    {/*<EField ref="eField" value={this.props.eField}/>*/}
                </WeaSearchGroup>
                {__DataSourceTable}
            </div>
        );
    }

    getSaveValues() {
        return {
            eContentTitle: this.refs['eTitle'] ? this.refs['eTitle'].getSaveValues() : this.props.eTitle,
            eContentShowNum: this.refs['eShowNum'].getSaveValues(),
            eContentLinkMode: this.refs['eLinkMode'].getSaveValues(),
            eContentShowHeader: this.refs['eShowHeader'].getSaveValues(),
            //eContentField: this.refs['eField'].getSaveValues(),
            eContentTabWidth: {tabwidth: this.props.etabwidth, methodvalue: this.props.methodvalue},
            eContentIsAlwaysShow: this.props.isAlwaysShow,
            eContenteTabStyle: {tabstyle: this.props.tabstyle, tabvalue: this.props.tabvalue, tabname: this.props.tabname},
            eTabs: this.refs['dataSourceTable'] ? this.refs['dataSourceTable'].getSaveValues() : {}
        };
    }
}